import BScroll from 'better-scroll'

window._BScroll = BScroll;

(function () {
    let template = function (self) {
        return `<aux-view content>${self.innerHTML}</aux-view>`;
    };
    
    document.auiDefineElement(
        'aum-scroll',
        {
            template,
            created(self) {
                self.$ele.content = self.children[0];
                self.$ele.content.auiAddOnceClass("wheel-scroll");
            },
            attached (self) {
                self.$control = new _BScroll(self, {
                    wheel:  {
                        selectedIndex: 0,
                        /** 默认值就是下面配置的两个，为了展示二者的作用，这里再配置一下 */
                        wheelWrapperClass: 'wheel-scroll',
                        wheelItemClass: 'wheel-item'
                      },
                })
            }
        }
    );
})();


